home *** CD-ROM | disk | FTP | other *** search
/ PC Pro 1997 July / PC Pro July 1997.iso / extras / globinet / disk1 / wsock16.z / GLOBAL.CMD < prev    next >
Encoding:
Text File  |  1995-11-01  |  1.4 KB  |  88 lines

  1. #trace on
  2. #
  3. # set up some strings for dialling up
  4. #
  5. if ![load $number]
  6.   if [query $number "Enter your dial up phone number"]
  7.     save $number
  8.   end
  9. end
  10. if ![load $lusername]
  11.   if [query $lusername "Enter your login username"]
  12.     save $lusername
  13.   end
  14. end
  15. if ![load $lpw]
  16.   if [query $lpw "Enter your login password"]
  17.     save $lpw
  18.   end
  19. end
  20. if ![load $modemsetup]
  21.   if [query $modemsetup "Enter your modem setup string"]
  22.     save $modemsetup
  23.   end
  24. end
  25. # $modemsetup = "&f"
  26. $userprompt = "gin:"
  27. $passprompt = "word:"
  28.  
  29. %attempts = 10
  30. #
  31. #
  32. #----------------------------------------------------------
  33. #
  34. # initialize modem
  35. #
  36. output "atz"\13
  37. if ! [input 10 OK\n]
  38.   display "Modem is not responding"\n
  39.   abort
  40. end
  41. #
  42. # setup our modem commands
  43. #
  44. output $modemsetup\13
  45. input 10 OK\n
  46. #
  47. # send phone number
  48. #
  49. %n = 0
  50. repeat
  51.   if %n = %attempts
  52.     display "Too many dial attempts"\n
  53.     abort
  54.   end
  55.   output "atdt"$number\13
  56.   %ok = [input 60 CONNECT]
  57.   %n = %n + 1
  58. until %ok
  59. input 10 \n
  60. #
  61. #  wait till it's safe to send because some modem's hang up
  62. #  if you transmit during the connection phase
  63. #
  64. #wait 30 dcd
  65. #
  66. # now prod the terminal server
  67. #
  68. output \13
  69. #
  70. #  wait for the username prompt
  71. #
  72. input 30 $userprompt
  73. output $lusername\13
  74. #
  75. # and the password
  76. #
  77. input 30 $passprompt
  78. output $lpw\13
  79. #
  80. # we are now logged in
  81. #
  82. display "Connected to Global Internet"\13
  83. sleep 6
  84. end
  85. #
  86. # now we are finished.
  87. #
  88.